Surface still-running extensions during MTP shutdown (refs #5345) - #8582
Merged
Amaury Levé (Evangelink) merged 4 commits intoJun 2, 2026
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes part of #5345 (incremental improvement, complementary to the phased-shutdown RFC in #8580).
Problem
Today when a user hits
Ctrl+Con a hanging MTP test run, the cancellation token gets signalled but the user has no visibility into which extension or consumer is blocking the shutdown. The process just appears stuck.Approach
Add a small
IShutdownProgressReporterservice that:using (reporter.Track(uid, displayName, phase)) { await ... }.Still waiting for: <Name1> (<Phase1>, <Ns>); <Name2> ...warning throughIOutputDevice.The three known blocking await sites are now wrapped:
ITestSessionLifetimeHandler.OnTestSessionFinishingAsync(non-consumer pass) —CommonTestHostITestSessionLifetimeHandler.OnTestSessionFinishingAsync(consumer pass) —CommonTestHostIAsyncConsumerDataProcessor.DrainDataAsyncper consumer —AsynchronousMessageBusThis is intentionally complementary to #8580. The RFC there proposes a full phased-shutdown protocol with a graceful timer and forced abort. The same trackers introduced here will feed the eventual
Force-killed because X didn't drainmessage in that bigger work — but in the meantime this PR ships value independently with zero behavior change on the happy path.Limitations
Uid/DisplayName).WarningMessageOutputDeviceData(yellow text); coordination with the live progress line is best-effort.PlatformResources.resx/ regenerated.xlffiles.Tests
7 new unit tests in
ShutdownProgressReporterTestscovering snapshot semantics, idempotent dispose, quiet-window behavior, post-cancellation emission, no-emit-if-all-disposed, and post-disposalTrack. All pass on net9.0 and net462.Out of scope